package com.io.stream.iochar;

import java.nio.charset.StandardCharsets;

public class EnDeCode {
    public static void main(String[] args) throws Exception {
        String var = "IO流" ;
        // 编码
        byte[] enVar = var.getBytes(StandardCharsets.UTF_8) ;
        for (byte encode:enVar){
            System.out.println(encode);
        }
        // 解码
        String deVar = new String(enVar,StandardCharsets.UTF_8) ;
        System.out.println(deVar);
        // 乱码
        String messyVar = new String(enVar,StandardCharsets.ISO_8859_1) ;
        System.out.println(messyVar);
    }
}
